﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Heavy_Metals
{
    public partial class QYXX : Form
    {
        public QYXX()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "";
            this.textBox2.Text = "";
        }

        private void QYXX_Load(object sender, EventArgs e)
        {
            DataGridViewLinkColumn lc = new DataGridViewLinkColumn();
            lc.HeaderText = "删除";
            lc.Name = "删除";
            lc.Width = 60;
            DataGridViewLinkColumn lc1 = new DataGridViewLinkColumn();
            lc1.HeaderText = "查看与修改";
            lc1.Name = "查看与修改";
            lc1.Width = 60;
            this.dataGridView1.Columns.Add("企业名称", "企业名称");
            this.dataGridView1.Columns.Add("法人代码", "法人代码");
            this.dataGridView1.Columns.Add("详细地址", "详细地址");
            this.dataGridView1.Columns.Add("联系电话", "联系电话");
            this.dataGridView1.Columns.Add("电子邮箱", "电子邮箱");
            this.dataGridView1.Columns.Add("企业规模", "企业规模(人)");
            this.dataGridView1.Columns.Add("年盈利", "年盈利(万元)");
            this.dataGridView1.Columns.Add("企业性质", "企业性质");
            this.dataGridView1.Columns.Add(lc1);
            this.dataGridView1.Columns.Add(lc);
            this.dataGridView1.Rows.Add("A企业", "2235", "哈尔滨市西大直街98号", "18745798208", "22335@163.com", "300", "7255", "国企","查看与修改", "删除");
            this.dataGridView1.Rows.Add("大庆化工", "de22", "大庆市24号", "", "salfsl@126.com", "6600", "7655", "私企", "查看与修改", "删除");
            this.dataGridView1.Rows.Add("111", "222", "333", "444", "555", "666", "777", "888", "查看与修改","删除");
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1)
            {
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "删除")
                {
                    this.dataGridView1.Rows.RemoveAt(e.RowIndex);
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "查看与修改")
                {
                    QYXX_CKXG ckxg = new QYXX_CKXG();
                    ckxg.Show();
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Rows.Add("A企业", "2235", "哈尔滨市西大直街98号", "18745798208", "22335@163.com", "300", "7255", "国企", "查看与修改", "删除");
        }
    }
}
